package bigbrother.log.logentries;

import bigbrother.log.daylog.DayLogId;
import org.joda.time.DateTime;

import java.io.Serializable;

/**
 * An interface for all the different messages that are logged for an IRC channel.
 * <p/>
 * Can be normal speech messages, actions, joins, parts, nickname changes, kicks, system messages, etc.
 * <p/>
 * Subclassed for different types of events.  The subclasses can contain more detailed fields.
 * <p/>
 * Log entries can be compared with each other, they are sorted according to their time stamps.
 *
 * @author Hans Haggstrom
 */
public interface LogEntry
        extends Comparable<LogEntry>, Serializable
{
    /**
     * @return the timestamp for this message, as a Joda-time {@link DateTime}.
     */
    DateTime getTimeStamp();

    /**
     * @return the channel the message appeared in (including the leading # character), or the nick name of the other
     *         person if it was a private conversation.
     */
    String getChannel();

    /**
     * @return the nickname of the person or system that the log entry is associated with (the person who said
     *         something, changed the topic, got kicked, etc).
     */
    String getNick();

    /**
     * @return the log entry content itself as a text string.
     */
    String getAsString();

    /**
     * @return the {@link DayLogId} for this LogEntry.  Specifies the channel and date of the LogEntry.
     */
    DayLogId getDayLogId();

}
